<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="货转单号" prop="goodsTransferNumber">
        <el-input
          v-model="queryParams.goodsTransferNumber"
          placeholder="请输入货转单号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="原货权户" prop="originGoodsRightCustomer">
        <el-select v-model="queryParams.originGoodsRightCustomer" placeholder="请选择原货权客户" clearable filterable>
          <el-option
          v-for="dict in customerOptions"
              :key="dict.customerId"
              :label="dict.customerName"
              :value="dict.customerName"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="新货权户" prop="newGoodsRightCustomer">
        <el-select v-model="queryParams.newGoodsRightCustomer" placeholder="请选择新货权客户" clearable filterable>
          <el-option
          v-for="dict in customerOptions"
              :key="dict.customerId"
              :label="dict.customerName"
              :value="dict.customerName"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="货转状态" prop="goodsTransferStatus">
        <el-select v-model="queryParams.goodsTransferStatus" placeholder="请选择货转状态" clearable>
          <el-option
            v-for="dict in dict.type.goods_transfer_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <!--el-form-item label="货转时间">
        <el-date-picker
          v-model="daterangeGoodsTransferTime"
          style="width: 205px"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        ></el-date-picker>
      </el-form-item>
      <el-form-item label="退回原因" prop="goodsTransferReturnReason">
        <el-input
          v-model="queryParams.goodsTransferReturnReason"
          placeholder="请输入退回原因"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="货转审核人" prop="goodsTransferAuditPerson">
        <el-input
          v-model="queryParams.goodsTransferAuditPerson"
          placeholder="请输入货转审核人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="货转审核时间">
        <el-date-picker
          v-model="daterangeGoodsTransferAuditTime"
          style="width: 205px"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        ></el-date-picker>
      </el-form-item>
      <el-form-item label="捆包号" prop="bundleNumber">
        <el-input
          v-model="queryParams.bundleNumber"
          placeholder="请输入捆包号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="货物类型" prop="goodsType">
        <el-select v-model="queryParams.goodsType" placeholder="请选择货物类型" clearable>
          <el-option
            v-for="dict in dict.type.goods_type"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="品名" prop="product">
        <el-input
          v-model="queryParams.product"
          placeholder="请输入品名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="规格" prop="specification">
        <el-input
          v-model="queryParams.specification"
          placeholder="请输入规格"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="材质" prop="steelGrade">
        <el-input
          v-model="queryParams.steelGrade"
          placeholder="请输入材质"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="重量(吨)" prop="weight">
        <el-input
          v-model="queryParams.weight"
          placeholder="请输入重量(吨)"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="磅重(吨)" prop="poundWeight">
        <el-input
          v-model="queryParams.poundWeight"
          placeholder="请输入磅重(吨)"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="理重(吨)" prop="theoryWeight">
        <el-input
          v-model="queryParams.theoryWeight"
          placeholder="请输入理重(吨)"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="件数" prop="numberOfPiece">
        <el-input
          v-model="queryParams.numberOfPiece"
          placeholder="请输入件数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="库存状态" prop="inventoryStatus">
        <el-select v-model="queryParams.inventoryStatus" placeholder="请选择库存状态" clearable>
          <el-option
            v-for="dict in dict.type.inventory_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="仓库类型" prop="warehouseType">
        <el-select v-model="queryParams.warehouseType" placeholder="请选择仓库类型" clearable>
          <el-option
            v-for="dict in dict.type.warehouse_type"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="园区信息" prop="logisticsParkName">
        <el-select v-model="queryParams.logisticsParkName" placeholder="请选择园区信息" clearable>
          <el-option
            v-for="dict in dict.type.sys_yes_no"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="仓位信息" prop="warehouseLocateName">
        <el-select v-model="queryParams.warehouseLocateName" placeholder="请选择仓位信息" clearable>
          <el-option
            v-for="dict in dict.type.sys_yes_no"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="区位信息" prop="regionLocateName">
        <el-select v-model="queryParams.regionLocateName" placeholder="请选择区位信息" clearable>
          <el-option
            v-for="dict in dict.type.sys_yes_no"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="货位信息" prop="goodsLocateName">
        <el-select v-model="queryParams.goodsLocateName" placeholder="请选择货位信息" clearable>
          <el-option
            v-for="dict in dict.type.sys_yes_no"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="层位信息" prop="layerLocateName">
        <el-select v-model="queryParams.layerLocateName" placeholder="请选择层位信息" clearable>
          <el-option
            v-for="dict in dict.type.sys_yes_no"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="库位信息" prop="warehouseTotalLocate">
        <el-input
          v-model="queryParams.warehouseTotalLocate"
          placeholder="请输入库位信息"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注" prop="remark">
        <el-input
          v-model="queryParams.remark"
          placeholder="请输入备注"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="结算状态" prop="goodsTransferSettlementStatus">
        <el-select v-model="queryParams.goodsTransferSettlementStatus" placeholder="请选择结算状态" clearable>
          <el-option
            v-for="dict in dict.type.settlement_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="结算客户" prop="goodsTransferSettlementCustomer">
        <el-select v-model="queryParams.goodsTransferSettlementCustomer" placeholder="请选择结算客户" clearable filterable>
          <el-option
            v-for="dict in dict.type.sys_yes_no"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="结算方式" prop="goodsTransferSettlementMode">
        <el-select v-model="queryParams.goodsTransferSettlementMode" placeholder="请选择结算方式" clearable>
          <el-option
            v-for="dict in dict.type.settlement_mode"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="折扣模式" prop="goodsTransferDiscountMode">
        <el-select v-model="queryParams.goodsTransferDiscountMode" placeholder="请选择折扣模式" clearable>
          <el-option
            v-for="dict in dict.type.discount_mode"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="折扣额度" prop="goodsTransferDiscountAmount">
        <el-input
          v-model="queryParams.goodsTransferDiscountAmount"
          placeholder="请输入折扣额度"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="记账ID" prop="goodsTransferAccountId">
        <el-input
          v-model="queryParams.goodsTransferAccountId"
          placeholder="请输入记账ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="记账编号" prop="goodsTransferAccountNumber">
        <el-input
          v-model="queryParams.goodsTransferAccountNumber"
          placeholder="请输入记账编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="作业状态" prop="jobStatus">
        <el-select v-model="queryParams.jobStatus" placeholder="请选择作业状态" clearable>
          <el-option
            v-for="dict in dict.type.job_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="结算客户" prop="settlementCustomer">
        <el-select v-model="queryParams.settlementCustomer" placeholder="请选择结算客户" clearable>
          <el-option
            v-for="dict in dict.type.sys_yes_no"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="结算方式" prop="settlementMode">
        <el-select v-model="queryParams.settlementMode" placeholder="请选择结算方式" clearable>
          <el-option
            v-for="dict in dict.type.settlement_mode"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="账单编号" prop="billNumber">
        <el-input
          v-model="queryParams.billNumber"
          placeholder="请输入账单编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="账单状态" prop="billStatus">
        <el-select v-model="queryParams.billStatus" placeholder="请选择账单状态" clearable>
          <el-option
            v-for="dict in dict.type.bill_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.label"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="告警状态" prop="alarmStatus">
        <el-input
          v-model="queryParams.alarmStatus"
          placeholder="请输入告警状态"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="告警描述" prop="alarmDescription">
        <el-input
          v-model="queryParams.alarmDescription"
          placeholder="请输入告警描述"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="园区代码" prop="parkCode">
        <el-input
          v-model="queryParams.parkCode"
          placeholder="请输入园区代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item-->
      <el-form-item label="创建者" prop="createBy">
        <el-input
          v-model="queryParams.createBy"
          placeholder="请输入创建者"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="创建时间">
        <el-date-picker
          v-model="daterangeCreateTime"
          style="width: 205px"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        ></el-date-picker>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['transfers:transfer:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['transfers:transfer:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['transfers:transfer:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['transfers:transfer:export']"
        >导出</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-baseball"
          size="mini"
          :disabled="single"
          @click="handleAddGoods"
          v-hasPermi="['transfers:transfer:goods']"
        >加货</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-s-home"
          size="mini"
          :disabled="single"
          @click="handleTransferAudit"
          v-hasPermi="['transfers:transfer:audit']"
        >审核</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-printer"
          size="mini"
          :disabled="single"
          @click="handlePrint"
          v-hasPermi="['transfers:transfer:print']"
        >打印</el-button>
      </el-col>
      <el-col :span="1.5" v-for="(item, index) in transferWeightSumList" :key="index">
        <el-tag type="" size="medium" effect="dark" >{{ item.inventoryStatus }} : {{ item.weightSum }}</el-tag>
      </el-col>

      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" @computeTable="computeTableHeight"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" ref="dataList" :data="transferList" @selection-change="handleSelectionChange" @row-click="handleRowClick" border :height="tableHeight" :row-style="{height:'35px'}" :cell-style="{padding:'0px'}">
      <el-table-column type="selection" width="45" align="center" />
      <el-table-column type="index" prop="" width="55" label="序号" align="center" >
        <template slot-scope="scope">
          <span>{{ scope.$index+1 +(queryParams.pageNum-1)*queryParams.pageSize }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100%">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['transfers:transfer:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['transfers:transfer:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
      <!--el-table-column label="货转ID" align="center" prop="goodsTransferId" /-->
      <el-table-column label="货转单号" align="center" prop="goodsTransferNumber" width="160" :show-overflow-tooltip="true" />
      <el-table-column label="原货权客户" align="center" prop="originGoodsRightCustomer" width="300" :show-overflow-tooltip="true" />
      <el-table-column label="新货权客户" align="center" prop="newGoodsRightCustomer" width="300" :show-overflow-tooltip="true" />
      <el-table-column label="货转状态" align="center" prop="goodsTransferStatus">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.goods_transfer_status" :value="scope.row.goodsTransferStatus"/>
        </template>
      </el-table-column>
      <el-table-column label="货转时间" align="center" prop="goodsTransferTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.goodsTransferTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="退回原因" align="center" prop="goodsTransferReturnReason" width="180" :show-overflow-tooltip="true"/>
      <el-table-column label="货转审核" align="center" prop="goodsTransferAuditPerson" />
      <el-table-column label="货转审核时间" align="center" prop="goodsTransferAuditTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.goodsTransferAuditTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>
      <!--el-table-column label="捆包号" align="center" prop="bundleNumber" />
      <el-table-column label="货物类型" align="center" prop="goodsType" />
      <el-table-column label="品名" align="center" prop="product" />
      <el-table-column label="规格" align="center" prop="specification" />
      <el-table-column label="材质" align="center" prop="steelGrade" />
      <el-table-column label="重量(吨)" align="center" prop="weight" />
      <el-table-column label="磅重(吨)" align="center" prop="poundWeight" />
      <el-table-column label="理重(吨)" align="center" prop="theoryWeight" />
      <el-table-column label="件数" align="center" prop="numberOfPiece" />
      <el-table-column label="库存状态" align="center" prop="inventoryStatus" />
      <el-table-column label="仓库类型" align="center" prop="warehouseType" />
      <el-table-column label="园区信息" align="center" prop="logisticsParkName" />
      <el-table-column label="仓位信息" align="center" prop="warehouseLocateName" />
      <el-table-column label="区位信息" align="center" prop="regionLocateName" />
      <el-table-column label="货位信息" align="center" prop="goodsLocateName" />
      <el-table-column label="层位信息" align="center" prop="layerLocateName" />
      <el-table-column label="库位信息" align="center" prop="warehouseTotalLocate" /-->
      <el-table-column label="货转凭证" align="center" prop="goodsTransferPicture" width="100">
        <template slot-scope="scope">
          <image-preview :src="scope.row.goodsTransferPicture" :width="50" :height="25"/>
        </template>
      </el-table-column>
      <el-table-column label="备注" align="center" prop="remark" width="180" :show-overflow-tooltip="true"/>
      <!--el-table-column label="结算状态" align="center" prop="goodsTransferSettlementStatus"/-->
      <el-table-column label="结算客户" align="center" prop="goodsTransferSettlementCustomer" width="300" :show-overflow-tooltip="true" />
      <!--el-table-column label="结算方式" align="center" prop="goodsTransferSettlementMode" />
      <el-table-column label="折扣模式" align="center" prop="goodsTransferDiscountMode" />
      <el-table-column label="折扣额度" align="center" prop="goodsTransferDiscountAmount" />
      <el-table-column label="记账ID" align="center" prop="goodsTransferAccountId" />
      <el-table-column label="记账编号" align="center" prop="goodsTransferAccountNumber" />
      <el-table-column label="作业状态" align="center" prop="jobStatus" />
      <el-table-column label="结算客户" align="center" prop="settlementCustomer" />
      <el-table-column label="结算方式" align="center" prop="settlementMode" />
      <el-table-column label="账单编号" align="center" prop="billNumber" />
      <el-table-column label="账单状态" align="center" prop="billStatus" />
      <el-table-column label="告警状态" align="center" prop="alarmStatus" />
      <el-table-column label="告警描述" align="center" prop="alarmDescription" /-->
      <el-table-column label="创建者" align="center" prop="createBy" />
      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
    <!--Good Detail-->
    <div class="line" />
    <!--el-divider></el-divider-->

    <goodsDetail ref="goodsDetail" />

    <!-- 添加或修改货转信息对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
        <!--el-form-item label="货转单号" prop="goodsTransferNumber">
          <el-input v-model="form.goodsTransferNumber" placeholder="请输入货转单号" clearable />
        </el-form-item-->
        <el-form-item label="原货权客户" prop="originGoodsRightCustomer">
          <el-select v-model="form.originGoodsRightCustomer" placeholder="请选择原货权客户" style="width: 340px;" clearable filterable>
            <el-option
            v-for="dict in customerOptions"
              :key="dict.customerId"
              :label="dict.customerName"
              :value="dict.customerName"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="新货权客户" prop="newGoodsRightCustomer">
          <el-select v-model="form.newGoodsRightCustomer" placeholder="请选择新货权客户" style="width: 340px;" clearable filterable>
            <el-option
              v-for="dict in customerOptions"
              :key="dict.customerId"
              :label="dict.customerName"
              :value="dict.customerName"
            ></el-option>
          </el-select>
        </el-form-item>
        <!--el-form-item label="货转状态" prop="goodsTransferStatus">
          <el-select v-model="form.goodsTransferStatus" placeholder="请选择货转状态" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.goods_transfer_status"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item-->
        <el-form-item label="货转时间" prop="goodsTransferTime">
          <el-date-picker clearable
            v-model="form.goodsTransferTime"
            type="datetime"
            value-format="yyyy-MM-dd HH:mm:ss"
            placeholder="请选择货转时间"
            style="width: 340px;">
          </el-date-picker>
        </el-form-item>
        <!--el-form-item label="退回原因" prop="goodsTransferReturnReason">
          <el-input v-model="form.goodsTransferReturnReason" placeholder="请输入退回原因" clearable />
        </el-form-item>
        <el-form-item label="货转审核人" prop="goodsTransferAuditPerson">
          <el-input v-model="form.goodsTransferAuditPerson" placeholder="请输入货转审核人" clearable />
        </el-form-item>
        <el-form-item label="货转审核时间" prop="goodsTransferAuditTime">
          <el-date-picker clearable
            v-model="form.goodsTransferAuditTime"
            type="datetime"
            value-format="yyyy-MM-dd HH:mm:ss"
            placeholder="请选择货转审核时间"
            style="width: 340px;">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="捆包号" prop="bundleNumber">
          <el-input v-model="form.bundleNumber" placeholder="请输入捆包号" clearable />
        </el-form-item>
        <el-form-item label="货物类型" prop="goodsType">
          <el-select v-model="form.goodsType" placeholder="请选择货物类型" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.goods_type"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="品名" prop="product">
          <el-input v-model="form.product" placeholder="请输入品名" clearable />
        </el-form-item>
        <el-form-item label="规格" prop="specification">
          <el-input v-model="form.specification" placeholder="请输入规格" clearable />
        </el-form-item>
        <el-form-item label="材质" prop="steelGrade">
          <el-input v-model="form.steelGrade" placeholder="请输入材质" clearable />
        </el-form-item>
        <el-form-item label="重量(吨)" prop="weight">
          <el-input v-model="form.weight" placeholder="请输入重量(吨)" clearable />
        </el-form-item>
        <el-form-item label="磅重(吨)" prop="poundWeight">
          <el-input v-model="form.poundWeight" placeholder="请输入磅重(吨)" clearable />
        </el-form-item>
        <el-form-item label="理重(吨)" prop="theoryWeight">
          <el-input v-model="form.theoryWeight" placeholder="请输入理重(吨)" clearable />
        </el-form-item>
        <el-form-item label="件数" prop="numberOfPiece">
          <el-input v-model="form.numberOfPiece" placeholder="请输入件数" clearable />
        </el-form-item>
        <el-form-item label="库存状态" prop="inventoryStatus">
          <el-select v-model="form.inventoryStatus" placeholder="请选择库存状态" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.inventory_status"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="仓库类型" prop="warehouseType">
          <el-select v-model="form.warehouseType" placeholder="请选择仓库类型" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.warehouse_type"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="园区信息" prop="logisticsParkName">
          <el-select v-model="form.logisticsParkName" placeholder="请选择园区信息" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.sys_yes_no"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="仓位信息" prop="warehouseLocateName">
          <el-select v-model="form.warehouseLocateName" placeholder="请选择仓位信息" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.sys_yes_no"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="区位信息" prop="regionLocateName">
          <el-select v-model="form.regionLocateName" placeholder="请选择区位信息" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.sys_yes_no"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="货位信息" prop="goodsLocateName">
          <el-select v-model="form.goodsLocateName" placeholder="请选择货位信息" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.sys_yes_no"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="层位信息" prop="layerLocateName">
          <el-select v-model="form.layerLocateName" placeholder="请选择层位信息" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.sys_yes_no"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="库位信息" prop="warehouseTotalLocate">
          <el-input v-model="form.warehouseTotalLocate" placeholder="请输入库位信息" clearable />
        </el-form-item-->
        <el-form-item label="货转凭证" prop="goodsTransferPicture">
          <image-upload v-model="form.goodsTransferPicture" :limit="2" />
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" placeholder="请输入备注" clearable />
        </el-form-item>
        <!--el-form-item label="结算状态" prop="goodsTransferSettlementStatus">
          <el-select v-model="form.goodsTransferSettlementStatus" placeholder="请选择结算状态" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.settlement_status"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="结算客户" prop="goodsTransferSettlementCustomer">
          <el-select v-model="form.goodsTransferSettlementCustomer" placeholder="请选择结算客户" style="width: 340px;" clearable filterable>
            <el-option
              v-for="dict in dict.type.sys_yes_no"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="结算方式" prop="goodsTransferSettlementMode">
          <el-select v-model="form.goodsTransferSettlementMode" placeholder="请选择结算方式" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.settlement_mode"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="折扣模式" prop="goodsTransferDiscountMode">
          <el-select v-model="form.goodsTransferDiscountMode" placeholder="请选择折扣模式" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.discount_mode"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="折扣额度" prop="goodsTransferDiscountAmount">
          <el-input v-model="form.goodsTransferDiscountAmount" placeholder="请输入折扣额度" clearable />
        </el-form-item>
        <el-form-item label="记账ID" prop="goodsTransferAccountId">
          <el-input v-model="form.goodsTransferAccountId" placeholder="请输入记账ID" clearable />
        </el-form-item>
        <el-form-item label="记账编号" prop="goodsTransferAccountNumber">
          <el-input v-model="form.goodsTransferAccountNumber" placeholder="请输入记账编号" clearable />
        </el-form-item>
        <el-form-item label="作业状态" prop="jobStatus">
          <el-select v-model="form.jobStatus" placeholder="请选择作业状态" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.job_status"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="结算客户" prop="settlementCustomer">
          <el-select v-model="form.settlementCustomer" placeholder="请选择结算客户" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.sys_yes_no"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="结算方式" prop="settlementMode">
          <el-select v-model="form.settlementMode" placeholder="请选择结算方式" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.settlement_mode"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="账单编号" prop="billNumber">
          <el-input v-model="form.billNumber" placeholder="请输入账单编号" clearable />
        </el-form-item>
        <el-form-item label="账单状态" prop="billStatus">
          <el-select v-model="form.billStatus" placeholder="请选择账单状态" style="width: 340px;" clearable>
            <el-option
              v-for="dict in dict.type.bill_status"
              :key="dict.value"
              :label="dict.label"
              :value="dict.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="告警状态" prop="alarmStatus">
          <el-input v-model="form.alarmStatus" placeholder="请输入告警状态" clearable />
        </el-form-item>
        <el-form-item label="告警描述" prop="alarmDescription">
          <el-input v-model="form.alarmDescription" placeholder="请输入告警描述" clearable />
        </el-form-item>
        <el-form-item label="园区代码" prop="parkCode">
          <el-input v-model="form.parkCode" placeholder="请输入园区代码" clearable />
        </el-form-item-->
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
    <!-- 添加货物对话框 -->
    <!-- 使用组件-->
    <addGoodsDialog ref="addGoodsDialog" title="添加货物" open="false" :refreshGoodsDetail="refreshGoodsDetail" style="display: none;"/>
    <auditDialog ref="auditDialog" title="货转审核" open="false" style="display: none;"/>
  </div>
</template>

<script>
import { listTransfer, getTransfer, delTransfer, addTransfer, updateTransfer, getTransferWeightSum } from "@/api/transfers/transfer";
import { listCustomerOption } from "@/api/customs/custom";
import addGoodsDialog from "./addGoodsDialog";
import goodsDetail from "./goodsDetail";
import { isNotNull } from "@/utils/validate";
import auditDialog from "./auditDialog";
import { getModeByCustomerName } from "@/api/fees/mode";

export default {
  components: {
    addGoodsDialog,
    goodsDetail,
    auditDialog,
  },
  name: "Transfer",
  dicts: ['warehouse_type', 'settlement_status', 'discount_mode', 'job_status', 'sys_yes_no', 'settlement_mode', 'goods_transfer_status', 'bill_status', 'goods_type', 'inventory_status'],
  data() {
    return {
      // 定义列表高度
      tableHeight: 430,
      // 定义查询高度
      queryHeight: 200,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 货转信息表格数据
      transferList: [],
      //选择列表
      selectList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 园区代码时间范围
      daterangeGoodsTransferTime: [],
      // 园区代码时间范围
      daterangeGoodsTransferAuditTime: [],
      // 园区代码时间范围
      daterangeCreateTime: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        goodsTransferNumber: null,
        originGoodsRightCustomer: null,
        newGoodsRightCustomer: null,
        goodsTransferStatus: null,
        goodsTransferTime: null,
        goodsTransferReturnReason: null,
        goodsTransferAuditPerson: null,
        goodsTransferAuditTime: null,
        bundleNumber: null,
        goodsType: null,
        product: null,
        specification: null,
        steelGrade: null,
        weight: null,
        poundWeight: null,
        theoryWeight: null,
        numberOfPiece: null,
        inventoryStatus: null,
        warehouseType: null,
        logisticsParkName: null,
        warehouseLocateName: null,
        regionLocateName: null,
        goodsLocateName: null,
        layerLocateName: null,
        warehouseTotalLocate: null,
        goodsTransferPicture: null,
        remark: null,
        goodsTransferSettlementStatus: null,
        goodsTransferSettlementCustomer: null,
        goodsTransferSettlementMode: null,
        goodsTransferDiscountMode: null,
        goodsTransferDiscountAmount: null,
        goodsTransferAccountId: null,
        goodsTransferAccountNumber: null,
        jobStatus: null,
        settlementCustomer: null,
        settlementMode: null,
        billNumber: null,
        billStatus: null,
        alarmStatus: null,
        alarmDescription: null,
        parkCode: null,
        createBy: null,
        createTime: null,
      },
      // 表单参数
      form: {},
      // 字典项客户
      customerOptions: [],
      // 已选行
      hasSelectRow: [],
      //货转状态
      transferStatus: '0',
      // 货物重量合计
      transferWeightSumList: [],      
      // 表单校验
      rules: {
        originGoodsRightCustomer: [
          { required: true, message: "原货权客户不能为空", trigger: "change" }
        ],
        newGoodsRightCustomer: [
          { required: true, message: "新货权客户不能为空", trigger: "change" }
        ],
      }
    };
  },
  created() {
    this.getList();
    this.getOption();
  },
  mounted() {
    this.$nextTick(() =>{
      // 根据浏览器高度设置初始高度 - 按钮行高度28 - 页码行高度28 - （面包屑+TAB行）高度160
      this.queryHeight = this.$refs.queryForm.$el.offsetHeight;
      this.tableHeight = window.innerHeight - this.$refs.queryForm.$el.offsetHeight - 28 - 28 - 160;
      // 监听浏览器高度变化，改变表格高度
      window.onresize = () =>{
        this.tableHeight = window.innerHeight - this.$refs.queryForm.$el.offsetHeight - 28 - 28 - 160;
      }
    })
  },
  methods: {
    /** 查询货转信息列表 */
    getList() {
      this.loading = true;
      this.queryParams.params = {};
      if (null != this.daterangeGoodsTransferTime && '' != this.daterangeGoodsTransferTime) {
        this.queryParams.params["beginGoodsTransferTime"] = this.daterangeGoodsTransferTime[0];
        this.queryParams.params["endGoodsTransferTime"] = this.daterangeGoodsTransferTime[1];
      }
      if (null != this.daterangeGoodsTransferAuditTime && '' != this.daterangeGoodsTransferAuditTime) {
        this.queryParams.params["beginGoodsTransferAuditTime"] = this.daterangeGoodsTransferAuditTime[0];
        this.queryParams.params["endGoodsTransferAuditTime"] = this.daterangeGoodsTransferAuditTime[1];
      }
      if (null != this.daterangeCreateTime && '' != this.daterangeCreateTime) {
        this.queryParams.params["beginCreateTime"] = this.daterangeCreateTime[0];
        this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1];
      }
      listTransfer(this.queryParams).then(response => {
        this.transferList = response.rows;
        this.total = response.total;
        this.loading = false;
        this.handleHasSelectRow();
        this.handleTransferWeightSum();
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        goodsTransferId: null,
        goodsTransferNumber: null,
        originGoodsRightCustomer: null,
        newGoodsRightCustomer: null,
        goodsTransferStatus: null,
        goodsTransferTime: null,
        goodsTransferReturnReason: null,
        goodsTransferAuditPerson: null,
        goodsTransferAuditTime: null,
        bundleNumber: null,
        goodsType: null,
        product: null,
        specification: null,
        steelGrade: null,
        weight: null,
        poundWeight: null,
        theoryWeight: null,
        numberOfPiece: null,
        inventoryStatus: null,
        warehouseType: null,
        logisticsParkName: null,
        warehouseLocateName: null,
        regionLocateName: null,
        goodsLocateName: null,
        layerLocateName: null,
        warehouseTotalLocate: null,
        goodsTransferPicture: null,
        remark: null,
        goodsTransferSettlementStatus: null,
        goodsTransferSettlementCustomer: null,
        goodsTransferSettlementMode: null,
        goodsTransferDiscountMode: null,
        goodsTransferDiscountAmount: null,
        goodsTransferAccountId: null,
        goodsTransferAccountNumber: null,
        jobStatus: null,
        settlementCustomer: null,
        settlementMode: null,
        billNumber: null,
        billStatus: null,
        alarmStatus: null,
        alarmDescription: null,
        dataRealm: null,
        parkCode: null,
        delFlag: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.daterangeGoodsTransferTime = [];
      this.daterangeGoodsTransferAuditTime = [];
      this.daterangeCreateTime = [];
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.goodsTransferId)
      this.single = selection.length!==1
      this.multiple = !selection.length
      this.selectList = selection;
//      console.log('handleSelectionChange', this.ids);
      if(this.ids.length == 1){
        this.hasSelectRow = selection;
        this.$refs.goodsDetail.getDetailX(selection[0]);
      }
    },
    /** 新增按钮操作 */
    handleAdd() {
      /** Date原型添加如下的方法 */
      Date.prototype.format = function(fmt) { 
        var o = { 
            "M+" : this.getMonth()+1,                 //月份 
            "d+" : this.getDate(),                    //日 
            "h+" : this.getHours(),                   //小时 
            "m+" : this.getMinutes(),                 //分 
            "s+" : this.getSeconds(),                 //秒 
            "q+" : Math.floor((this.getMonth()+3)/3), //季度 
            "S"  : this.getMilliseconds()             //毫秒 
        }; 
        if(/(y+)/.test(fmt)) {
                fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length)); 
        }
        for(var k in o) {
            if(new RegExp("("+ k +")").test(fmt)){
                fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
            }
        }
        return fmt; 
      };
      this.reset();
      this.open = true;
      this.title = "添加货转信息";
      this.$set(this.form, 'goodsTransferStatus', this.transferStatus);
      this.$set(this.form, 'goodsTransferTime', new Date().format("yyyy-MM-dd hh:mm:ss"));

    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      //console.log('handleUpdate', row);
      const selection =  this.selectList[0];
      if((row && row.goodsTransferStatus == '1') || (selection && selection.goodsTransferStatus == '1')) {
        this.$modal.msgError('该货转单已审核通过，不允许修改');
        return;
      }
      this.reset();
      const goodsTransferId = row.goodsTransferId || this.ids
      getTransfer(goodsTransferId).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改货转信息";
      });
    },
    /** 提交按钮 */
    submitForm() {
      if (this.form.originGoodsRightCustomer == this.form.newGoodsRightCustomer) {
        this.$modal.msgError("原客户和新客户不能相同");
      } else {
        this.$refs["form"].validate(valid => {
          if (valid) {
            if (this.form.goodsTransferId != null) {
              updateTransfer(this.form).then(response => {
                this.$modal.msgSuccess("修改成功");
                this.open = false;
                this.getList();
              }).catch((e) => {
                console.log('e', e);
                this.open = false;
                this.getList();
              });
            } else {
              if (this.form.originGoodsRightCustomer == this.form.newGoodsRightCustomer) {
                this.$modal.msgError("原客户和新客户不能相同");
              } else {
                addTransfer(this.form).then(response => {
                  this.$modal.msgSuccess("新增成功");
                  this.open = false;
                  this.getList();
                });
              }
            }
          }
        });
      }
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const goodsTransferIds = row.goodsTransferId || this.ids;
      const selection =  this.selectList[0];
      if((row && row.goodsTransferStatus == '1') || (selection && selection.goodsTransferStatus == '1')) {
        this.$modal.msgError('该货转单已审核通过，不允许删除');
        return;
      }
      let information;
//      console.log("transfer handleDelete row ", row);
      if(row && row.goodsTransferNumber) {
        information = '是否删除货转单"' + row.goodsTransferNumber + '"？';
      } else {
        if((this.selectList.length == 1) && (selection && selection.goodsTransferNumber)) {
          information = '是否删除货转单"' + selection.goodsTransferNumber + '"？';
        } else {
          information = '是否删除货转单？';
        }
      }
      this.$modal.confirm(information).then(function() {
        return delTransfer(goodsTransferIds);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch((e) => {
        console.log('e', e);
        this.getList();
      });
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('transfers/transfer/export', {
        ...this.queryParams
      }, `transfer_${new Date().getTime()}.xlsx`)
    },
    computeTableHeight(){
      if( this.showSearch==true ){
        this.tableHeight = window.innerHeight - this.queryHeight - 28 - 28 - 160;
      } else {
        this.tableHeight = window.innerHeight - 28 - 28 - 160;
      }
    },
    getOption() {
      /** 字典项客户*/
      listCustomerOption().then(response => {
        this.customerOptions = response.data;

//        console.log('this.customerOptions',this.customerOptions);
      });

    },
    handleAddGoods(){
//      console.log("handleAddGoods");
//      console.log("this.selectList.goodsTransferId", this.selectList[0].goodsTransferId);
      if(this.selectList[0].goodsTransferStatus == '1'){
        this.$modal.msgError('该货转单已审核通过，不能再进行加货');
      } else {
        this.$refs.addGoodsDialog.init(true, "添加货物", this.selectList[0].goodsTransferId, this.selectList[0]);
      }
    },
    handleRowClick(row, column, event){
//      console.log("row = ", row.goodsTransferId);
      //console.log("column = ", column);
      //console.log("event = ", event);
      if(this.selectList[0] == row)
      {
        this.selectList = [];
        this.$refs['dataList'].clearSelection();
        this.hasSelectRow = [];
      } else {
        this.selectList = [row];
        this.$refs['dataList'].clearSelection();
        this.$refs['dataList'].toggleRowSelection(row, true);
        this.hasSelectRow = [row];
      }
//      this.$refs.goodsDetail.getDetail(row.goodsTransferId);
//      this.$refs.goodsDetail.getDetailX(row);
    },
    refreshGoodsDetail(goodsTransferId){
//      console.log('refreshGoodsDetail');
      this.$refs.goodsDetail.getDetail(goodsTransferId);
    },
    handleHasSelectRow(){
//      console.log('transfer handleHasSelectRow');
      if(isNotNull(this.hasSelectRow))
      {
        this.$nextTick(() => {
//          console.log("handleHasSelectRow", this.hasSelectRow[0].goodsTransferId);
          //this.selectList = [this.hasSelectRow];
          this.transferList.forEach((row) => {
//            console.log("handleHasSelectRow, transferList", row.goodsTransferId);
            if(row.goodsTransferId === this.hasSelectRow[0].goodsTransferId){
              //this.$refs['dataList'].clearSelection();
              this.$refs['dataList'].toggleRowSelection(row, true);
//              console.log("handleHasSelectRow, row", row);
//              this.$refs.goodsDetail.getDetail(this.hasSelectRow[0].goodsTransferId);
              if(isNotNull(this.$refs.goodsDetail))
                this.$refs.goodsDetail.getDetailX(this.hasSelectRow[0]);
            }
          });
        });
      } else {
        if (isNotNull(this.transferList[0])) {
          //
          if (isNotNull(this.transferList[0].goodsTransferId)) {
            //console.log("this.transferList[0].goodsTransferId", this.transferList[0].goodsTransferId);
//            this.$refs.goodsDetail.getDetail(this.transferList[0].goodsTransferId);
            if(isNotNull(this.$refs.goodsDetail))
              this.$refs.goodsDetail.getDetailX(this.transferList[0]);
          }
        } else {
          this.$refs.goodsDetail.clearDetail();
        }
      }

    },
    handleTransferAudit(row){
//      console.log('handleTransferAudit', this.selectList);
//      console.log('this.$refs.goodsDetail.total', this.$refs.goodsDetail.total);
      if (this.$refs.goodsDetail.total > 0) {
        this.$refs.auditDialog.init(true, '货转审核', this.selectList[0].goodsTransferId, this.selectList[0])
      } else {
        this.$modal.msgError('该货转单下无货，不能进行货转审核操作');
      }
    },
    handlePrint() {
//      console.log('handlePrint this.$route ', this.$route );
//      console.log('handlePrint this.$router ', this.$router );
      this.$router.push({
        path: '/printtransfer',
        query: {
          id: this.selectList[0].goodsTransferId,
          list: this.selectList,
          name: '货转单打印'
        }
      })     
    },
    handleTransferWeightSum()
    {
      let query = {
        goodsTransferNumber: this.queryParams.goodsTransferNumber,
        originGoodsRightCustomer: this.queryParams.originGoodsRightCustomer,
        newGoodsRightCustomer: this.queryParams.newGoodsRightCustomer,
        goodsTransferStatus: this.queryParams.goodsTransferStatus,
      };
//      console.log('query', query);
      getTransferWeightSum(query).then(response => {
        this.transferWeightSumList = response.data;
//        console.log('response.data = ', response.data);
      });
    },
    handleChangeCustomer(value) {
//      console.log('handleChangeCustomer', value);
      getModeByCustomerName(value).then(response => {
        if(isNotNull(response.data)) {
          this.form.settlementMode = response.data.settlementMode;
        } else {
          this.form.settlementMode = '';
        }
      });
    },
  }
};
</script>

<!--style rel="stylesheet/scss" lang="scss"-->
<style lang="less" scoped>
/* 横线 */
.line{
  float:right;
  width: 100%;
  height: 1px;
  margin-top: 0.5em;
  margin-bottom: 0.25em;
  background:#d4c4c4;
  position: relative;
  text-align: center;
}

</style>